# god is a dog
from django.views.decorators.http import require_http_methods
from django.http import Http404
import accounts.views as av

def dispatcher(request, action):

    action_mapper = {
        'login' : av.login,
        'logout' : av.logout,
        'update' : av.update,
        'register' : av.register,
    }

    if action in action_mapper:
        act = action_mapper[action]
        return act(request)

    # get an unrecongnized request
    else:
        raise Http404
